package com.kong.rest;

import com.kong.config.db.DataSourceProperties;
import com.kong.config.db.TestRefreshConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <dl>
 * <dd>Description: 测试动态刷新配置的Controller</dd>
 * <dd>Company: 大诚若谷信息技术有限公司</dd>
 * <dd>@date：2017/6/15 11:14</dd>
 * <dd>@author：Kong</dd>
 * </dl>
 */
@RestController
@RequestMapping("/from")
public class TestReflushConfigRestController {

    @Autowired
    private TestRefreshConfig testRefreshConfig;

    @Autowired
    private DataSourceProperties dbProperties;

    @GetMapping()
    public String from() {
        String from = testRefreshConfig.getFrom();
        return from;
    }

    @GetMapping("/password")
    public String password(){
        String password = dbProperties.getPassword();
        return password;
    }
}
